package formbeans;

import java.util.ArrayList;
import java.util.List;

import org.mybeans.form.FormBean;

public class BasicQuestionForm extends FormBean {

	private String question;
	private String dynetmlAttr;
	
	public String getQuestion() {
		return question;
	}
	public String getDynetmlAttr() {
		return dynetmlAttr;
	}

	public void setQuestion(String question) {
		this.question = trimAndConvert(question,"<>\"");
	}
	public void setDynetmlAttr(String dynetmlAttr) {
		this.dynetmlAttr = trimAndConvert(dynetmlAttr,"<>\"");
	}
	
	public List<String> checkBasicQuestionFormErrors(){
		List<String> errors = new ArrayList<String>();
		
		if(question == null || question.length() == 0){
			errors.add("Please enter a question");
		}
		if(dynetmlAttr == null || dynetmlAttr.length() == 0){
			errors.add("Please enter dynetml attribute identifier");
		}
		
		return errors;
	}
}